<?php
$DB_IP="127.0.0.1";
$DB_USER="offer";
$DB_PASSWD="123456";
$DB_NAME="offer";
$DBP="offer_";

$TBL_PASSDB=$DBP."passdb";
$TBL_CUMAP=$DBP."cumap";
$TBL_USER=$DBP."user";
$TBL_COUNTER=$DBP."counter";


function connectDBInit() {
	global $DB_IP, $DB_USER, $DB_PASSWD, $DB_NAME, $DBP;
	return mysql_connect($DB_IP, $DB_USER, $DB_PASSWD);
}
function connectDB() {
	global $DB_IP, $DB_USER, $DB_PASSWD, $DB_NAME, $DBP;
	$link = mysql_connect($DB_IP, $DB_USER, $DB_PASSWD);
	if(!$link) {
		echo mysql_error();
		return "ERR_ERR";
	}
	$sql = "use $DB_NAME";
	if(!mysql_query($sql, $link)) {
		echo mysql_error();
		return "ERR_ERR";
	}
	return $link;
	
}
?>
